import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isLogin: true,
    itemQueryId: '',
    username: 'CJQ',
    userphone: '158******59',
    useremail: '19*******0@q*.com',
    activePage: '',
    orderListActiveName: 'first',
    items: [
      // 手机
      {
        itemId: 7,
        title: "Xiaomi 11 Pro",
        sellerType: "自营店",
        discountPrice: 3949,
        oldPrice: 4999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["8GB+128GB", "8GB+256GB", "12GB+256GB"],
        color: ["黑色", "绿色", "紫色"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item7/img1.jpg") },
          { url: require("@/assets/img/item/item7/img2.jpg") },
          { url: require("@/assets/img/item/item7/img3.jpg") },
          { url: require("@/assets/img/item/item7/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item7/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item7/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item7/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item7/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item7/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item7/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 6,
        title: "Redmi K40",
        sellerType: "自营店",
        discountPrice: 2199,
        oldPrice: 2699,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["6GB+128GB", "8GB+128GB", "8GB+256GB", "12GB+256GB"],
        color: ["亮黑", "晴雪", "墨羽", "幻境"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item6/img1.jpg") },
          { url: require("@/assets/img/item/item6/img2.jpg") },
          { url: require("@/assets/img/item/item6/img3.jpg") },
          { url: require("@/assets/img/item/item6/img4.jpg") },
          { url: require("@/assets/img/item/item6/img5.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item6/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item6/detail/detail2.png") },
          { url: require("@/assets/img/item/item6/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item6/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item6/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item6/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 1,
        title: "Xiaomi 11 青春活力版",
        sellerType: "自营店",
        discountPrice: 1999,
        oldPrice: 2199,
        count: 1,
        havaActivity: true,
        activityItem: { tag: "赠品", title: "满1件赠价值79元Redmi AirDots 2真无线蓝牙耳机 白色 赠完即止" },
        isFavorite: false,
        version: ["8GB+128GB", "8GB+256GB"],
        color: ["晴光白雪", "樱花蜜粉", "冰峰黑提", "清凉薄荷"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item1/img1.png") },
          { url: require("@/assets/img/item/item1/img2.png") },
          { url: require("@/assets/img/item/item1/img3.png") },
          { url: require("@/assets/img/item/item1/img4.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item1/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail6.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail7.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail8.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail9.jpg") },
          { url: require("@/assets/img/item/item1/detail/detail10.jpg") },
        ]
      },
      {
        itemId: 5,
        title: "Xiaomi 12 Pro",
        sellerType: "自营店",
        discountPrice: 5199,
        oldPrice: 5399,
        count: 1,
        havaActivity: true,
        activityItem: { tag: "赠品", title: "满1件赠价值79元Redmi AirDots 2真无线蓝牙耳机 白色 赠完即止" },
        isFavorite: false,
        version: ["8GB+128GB", "8GB+256GB", "12GB+256GB"],
        color: ["黑色", "蓝色", "紫色", "原野绿（素皮）"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item5/img1.png") },
          { url: require("@/assets/img/item/item5/img2.png") },
          { url: require("@/assets/img/item/item5/img3.png") },
          { url: require("@/assets/img/item/item5/img4.png") },
          { url: require("@/assets/img/item/item5/img5.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item5/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail6.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail7.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail8.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail9.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail10.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail11.jpg") },
          { url: require("@/assets/img/item/item5/detail/detail12.jpg") },
        ]
      },
      //电视
      {
        itemId: 8,
        title: "Redmi X65 2022款",
        sellerType: "自营店",
        discountPrice: 3499,
        oldPrice: 3999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["65英寸"],
        color: ["蓝色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item8/img1.jpg") },
          { url: require("@/assets/img/item/item8/img2.jpg") },
          { url: require("@/assets/img/item/item8/img3.jpg") },
          { url: require("@/assets/img/item/item8/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item8/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item8/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item8/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item8/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item8/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item8/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 9,
        title: "小米电视6 至尊版 55英寸",
        sellerType: "自营店",
        discountPrice: 5499,
        oldPrice: 5999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["55英寸"],
        color: ["灰色"],
        combo: ["标准版", "影视会员版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item9/img1.jpg") },
          { url: require("@/assets/img/item/item9/img2.jpg") },
          { url: require("@/assets/img/item/item9/img3.jpg") },
          { url: require("@/assets/img/item/item9/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item9/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item9/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item9/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item9/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item9/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item9/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 10,
        title: "小米电视 ES75 2022款",
        sellerType: "自营店",
        discountPrice: 5999,
        oldPrice: 6199,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["75英寸"],
        color: ["灰色"],
        combo: ["标准版", "影视会员版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item10/img1.jpg") },
          { url: require("@/assets/img/item/item10/img2.jpg") },
          { url: require("@/assets/img/item/item10/img3.jpg") },
          { url: require("@/assets/img/item/item10/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item10/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item10/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item10/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item10/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item10/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item10/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 11,
        title: "Redmi 智能电视 X55",
        sellerType: "自营店",
        discountPrice: 2399,
        oldPrice: 2699,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["55英寸"],
        color: ["灰色"],
        combo: ["标准版", "影视会员版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item11/img1.jpg") },
          { url: require("@/assets/img/item/item11/img2.jpg") },
          { url: require("@/assets/img/item/item11/img3.jpg") },
          { url: require("@/assets/img/item/item11/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item11/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item11/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item11/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item11/detail/detail4.jpg") },
        ]
      },
      // 笔记本 平板
      {
        itemId: 2,
        title: "小米平板5",
        sellerType: "自营店",
        discountPrice: 1949,
        oldPrice: 1999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["6GB+128GB", "6GB+256GB"],
        color: ["绿色", "白色", "黑色"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item2/img1.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item2/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail6.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail7.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail8.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail9.jpg") },
          { url: require("@/assets/img/item/item2/detail/detail10.jpg") },
        ]
      },
      {
        itemId: 12,
        title: "RedmiBook Pro 14 增强版",
        sellerType: "自营店",
        discountPrice: 4499,
        oldPrice: 4999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["Windows11"],
        color: ["绿色", "白色", "黑色"],
        combo: ["i7-11390H/MX450/16G/12G/2.5K"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item12/img1.jpg") },
          { url: require("@/assets/img/item/item12/img2.jpg") },
          { url: require("@/assets/img/item/item12/img3.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item12/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item12/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item12/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item12/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 13,
        title: "RedmiBook Pro 14 锐龙版",
        sellerType: "自营店",
        discountPrice: 4399,
        oldPrice: 4699,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["Windows11"],
        color: ["星光灰"],
        combo: ["R5 5500U/16G/512G"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item13/img1.jpg") },
          { url: require("@/assets/img/item/item13/img2.jpg") },
          { url: require("@/assets/img/item/item13/img3.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item13/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item13/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item13/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item13/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 14,
        title: "小米平板5 Pro",
        sellerType: "自营店",
        discountPrice: 3099,
        oldPrice: 3199,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["6GB+128GB", "6GB+256GB", "8GB+256GB"],
        color: ["白色", "黑色"],
        combo: ["标准版", "套餐版（赠充电器）"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item14/img1.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item14/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item14/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item14/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item14/detail/detail4.jpg") },
        ]
      },
      //家电
      {
        itemId: 3,
        title: "米家波轮洗衣机尊享版",
        sellerType: "自营店",
        discountPrice: 1799,
        oldPrice: 1899,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["尊享版9kg", "尊享版10kg"],
        color: ["钛灰色"],
        combo: ["标准版", "套餐版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item3/img1.jpg") },
          { url: require("@/assets/img/item/item3/img2.jpg") },
          { url: require("@/assets/img/item/item3/img3.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item3/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail6.jpg") },
          { url: require("@/assets/img/item/item3/detail/detail7.jpg") },
        ]
      },
      {
        itemId: 4,
        title: "米家防缠绕扫拖机器人",
        sellerType: "自营店",
        discountPrice: 1899,
        oldPrice: 2299,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["扫拖一体", "扫拖洗烘一体"],
        color: ["白色", "黑色"],
        combo: ["标准版", "套餐版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item4/img1.jpg") },
          { url: require("@/assets/img/item/item4/img2.jpg") },
          { url: require("@/assets/img/item/item4/img3.jpg") },
          { url: require("@/assets/img/item/item4/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item4/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item4/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item4/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item4/detail/detail4.jpg") },
          { url: require("@/assets/img/item/item4/detail/detail5.jpg") },
          { url: require("@/assets/img/item/item4/detail/detail6.jpg") },
        ]
      },
      {
        itemId: 15,
        title: "米家互联网对开门冰箱 540L",
        sellerType: "自营店",
        discountPrice: 2799,
        oldPrice: 3699,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["540L"],
        color: ["黑色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item15/img1.jpg") },
          { url: require("@/assets/img/item/item15/img2.jpg") },
          { url: require("@/assets/img/item/item15/img3.jpg") },
          { url: require("@/assets/img/item/item15/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item15/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item15/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item15/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item15/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 16,
        title: "米家冰箱 尊享版550L十字四门",
        sellerType: "自营店",
        discountPrice: 5699,
        oldPrice: 5999,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["550L"],
        color: ["黑色"],
        combo: ["尊享版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item16/img1.jpg") },
          { url: require("@/assets/img/item/item16/img2.jpg") },
          { url: require("@/assets/img/item/item16/img3.jpg") },
          { url: require("@/assets/img/item/item16/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item16/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item16/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item16/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item16/detail/detail4.jpg") },
        ]
      },
      //出行 穿戴
      {
        itemId: 17,
        title: "Xiaomi Watch S1",
        sellerType: "自营店",
        discountPrice: 1049,
        oldPrice: 1099,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["黑色氟橡胶表带", "蓝色真皮表带", "棕色真皮表带"],
        color: ["曜石黑", "流光银"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item17/img1.png") },
          { url: require("@/assets/img/item/item17/img2.png") },
          { url: require("@/assets/img/item/item17/img3.png") },
          { url: require("@/assets/img/item/item17/img4.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item17/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item17/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item17/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item17/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 18,
        title: "HIMO Z20 折叠电动助力自行车 便携电动车",
        sellerType: "自营店",
        discountPrice: 3299,
        oldPrice: 3499,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["20英寸"],
        color: ["白色", "灰色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item18/img1.jpg") },
          { url: require("@/assets/img/item/item18/img2.jpg") },
          { url: require("@/assets/img/item/item18/img3.jpg") },
          { url: require("@/assets/img/item/item18/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item18/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item18/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item18/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item18/detail/detail4.jpg") },
        ]
      },
      // 智能 路由
      {
        itemId: 19,
        title: "小米路由器AX9000",
        sellerType: "自营店",
        discountPrice: 1299,
        oldPrice: 1399,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["AX9000"],
        color: ["黑色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item19/img1.jpg") },
          { url: require("@/assets/img/item/item19/img2.jpg") },
          { url: require("@/assets/img/item/item19/img3.jpg") },
          { url: require("@/assets/img/item/item19/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item19/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item19/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item19/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item19/detail/detail4.jpg") },
        ]
      },
      // 电源 配件
      {
        itemId: 20,
        title: "小米充电宝 20000mAh 50W",
        sellerType: "自营店",
        discountPrice: 209,
        oldPrice: 219,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["20000mAh"],
        color: ["黑色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item20/img1.jpg") },
          { url: require("@/assets/img/item/item20/img2.jpg") },
          { url: require("@/assets/img/item/item20/img3.jpg") },
          { url: require("@/assets/img/item/item20/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item20/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item20/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item20/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item20/detail/detail4.jpg") },
        ]
      },
      //健康 儿童
      {
        itemId: 21,
        title: "米家跑步机",
        sellerType: "自营店",
        discountPrice: 2299,
        oldPrice: 2499,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["跑步机"],
        color: ["深空灰"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item21/img1.jpg") },
          { url: require("@/assets/img/item/item21/img2.jpg") },
          { url: require("@/assets/img/item/item21/img3.jpg") },
          { url: require("@/assets/img/item/item21/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item21/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item21/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item21/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item21/detail/detail4.jpg") },
        ]
      },
      // 耳机 音箱
      {
        itemId: 22,
        title: "Xiaomi真无线降噪耳机3",
        sellerType: "自营店",
        discountPrice: 449,
        oldPrice: 499,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["降噪耳机"],
        color: ["白色", "黑色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item22/img1.png") },
          { url: require("@/assets/img/item/item22/img2.png") },
          { url: require("@/assets/img/item/item22/img3.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item22/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item22/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item22/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item22/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 24,
        title: "Redmi Buds 3 青春版",
        sellerType: "自营店",
        discountPrice: 99,
        oldPrice: 109,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["无线耳机"],
        color: ["黑色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item24/img1.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item24/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item24/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item24/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item24/detail/detail4.jpg") },
        ]
      },
      {
        itemId: 25,
        title: "Redmi Buds 3半入耳真无线蓝牙耳机",
        sellerType: "自营店",
        discountPrice: 189,
        oldPrice: 199,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["无线耳机"],
        color: ["白色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item25/img1.png") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item25/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item25/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item25/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item25/detail/detail4.jpg") },
        ]
      },
      // 生活 箱包
      {
        itemId: 23,
        title: "小米小背包",
        sellerType: "自营店",
        discountPrice: 29,
        oldPrice: 36,
        count: 1,
        havaActivity: false,
        isFavorite: false,
        version: ["10L"],
        color: ["黑色", "白色", "深蓝", "亮蓝色"],
        combo: ["标准版"],
        itemSwiperImgUrl: [
          { url: require("@/assets/img/item/item23/img1.jpg") },
          { url: require("@/assets/img/item/item23/img2.jpg") },
          { url: require("@/assets/img/item/item23/img3.jpg") },
          { url: require("@/assets/img/item/item23/img4.jpg") },
        ],
        itemDetailImgUrl: [
          { url: require("@/assets/img/item/item23/detail/detail1.jpg") },
          { url: require("@/assets/img/item/item23/detail/detail2.jpg") },
          { url: require("@/assets/img/item/item23/detail/detail3.jpg") },
          { url: require("@/assets/img/item/item23/detail/detail4.jpg") },
        ]
      },
    ],
    cartCount: 0,
    cartItems: [],
    favoriteItemsCount: 0,
    favoriteItems: [],
    userShippingAddress: [
      {
        address: "广东交通职业技术学院",
        addressId: 1,
        detailAddress: "天源路789号",
        name: "蔡嘉祺",
        phone: "15875140659",
        tag: "学校",
      },
      // {
      //   address: "广东省阳江市阳西县",
      //   addressId: 2,
      //   detailAddress: "儒洞镇南华街3号",
      //   name: "蔡嘉祺",
      //   phone: "15875140659",
      //   tag: "家",
      // },
    ],
    userEditAddressInfo: [],
    userOrderList: [
      {
        orderListId: 1000001,
        status: "待支付",
        time: "2022-01-03 06:19:16",
        totalPrice: 5199,
        items: [
          {
            itemId: 1,
            title: "Xiaomi 11 青春活力版",
            sellerType: "自营店",
            discountPrice: 1999,
            oldPrice: 2199,
            count: 1,
            havaActivity: true,
            activityItem: { tag: "赠品", title: "满1件赠价值79元Redmi AirDots 2真无线蓝牙耳机 白色 赠完即止" },
            isFavorite: false,
            version: ["8GB + 128GB", "8GB + 256GB"],
            color: ["晴光白雪", "樱花蜜粉", "冰峰黑提", "清凉薄荷"],
            combo: ["标准版", "套餐版（赠充电器）"],
            itemSwiperImgUrl: [
              { url: require("@/assets/img/item/item1/img1.png") },
              { url: require("@/assets/img/item/item1/img2.png") },
              { url: require("@/assets/img/item/item1/img3.png") },
              { url: require("@/assets/img/item/item1/img4.png") },
            ],
            itemDetailImgUrl: [
              { url: require("@/assets/img/item/item1/detail/detail1.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail2.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail3.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail4.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail5.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail6.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail7.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail8.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail9.jpg") },
              { url: require("@/assets/img/item/item1/detail/detail10.jpg") },
            ]
          },
        ],
      }
    ],
  },
  mutations: {
    changeLoginStatus(state) {
      state.isLogin = !state.isLogin
    },
    changeActivePage(state, newActivePage) {
      state.activePage = newActivePage
    },
    changeOrderListActiveName(state, newActiveName) {
      state.orderListActiveName = newActiveName
    },
    changeItemQueryId(state, newItemId) {
      state.itemQueryId = newItemId
    },
    // 根据itemId将item加入购物车列表
    handleAddInCart(state, itemId) {
      const newItem = state.items.filter(n => n.itemId == itemId)
      // console.log(newItem[0]);
      if (state.cartItems.filter(n => n.itemId == itemId).length == 1) {
        // 检测购物车是否拥有这个item，如果有就使购物车中的count+1
        state.cartItems.filter((n, index) => {
          if (n.itemId == itemId) {
            state.cartItems[index].count++
          }
        })
      } else {
        // 如果没有就向购物车加入新的item
        state.cartItems.unshift(newItem[0])
        state.cartCount = state.cartItems.length
      }
    },
    // 根据购物车中传进来的index下标，将index对应的cartItems进行删除
    handleDeleteCartItem(state, index) {
      // console.log(state.cartItems[index]);
      state.cartItems.splice(index, 1)
      state.cartCount = state.cartItems.length
    },
    // 根据购物车中传进来的itemId，将cartItems中对应itemId的item进行删除
    handleDeleteCartItemByItemId(state, itemId) {
      state.cartItems.filter((n, index) => {
        if (n.itemId == itemId) {
          state.cartItems.splice(index, 1)
          state.cartCount = state.cartItems.length
          // console.log(state.cartItems);
        }
      })
    },
    // 根据itemId将对应item中的isFavorite修改，并将对应的item加入favoriteItems
    changeItemIsFavorite(state, itemId) {
      const checkItemisFavorite = state.items.filter(n => n.itemId == itemId)
      if (checkItemisFavorite[0].isFavorite == false) {
        // 检测item中的isFavorite是否为false,是false则将false改为true并加入favoriteItems
        state.items.filter((n, index) => {
          if (n.itemId == itemId) {
            state.items[index].isFavorite = !state.items[index].isFavorite
          }
        })
        const newItem = state.items.filter(n => n.itemId == itemId)
        state.favoriteItems.unshift(newItem[0])
        state.favoriteItemsCount = state.favoriteItems.length
      } else {
        // 是true则将item.isFavorite true改为false并从favoriteItems删除对应的item
        state.items.filter((n, index) => {
          if (n.itemId == itemId) {
            state.items[index].isFavorite = !state.items[index].isFavorite
          }
        })
        state.favoriteItems.filter((n, index) => {
          if (n.itemId == itemId) {
            state.favoriteItems.splice(index, 1)
            state.favoriteItemsCount = state.favoriteItems.length
          }
        })
      }
    },
    // 根据收藏夹中传进来的itemId，将favoriteItems对应的item进行删除，并将items对应的itemId的item的isFavorite改为false
    deleteFavoriteItems(state, itemId) {
      state.items.filter((n, index) => {
        if (n.itemId == itemId) {
          state.items[index].isFavorite = !state.items[index].isFavorite
        }
      })
      state.favoriteItems.filter((n, index) => {
        if (n.itemId == itemId) {
          state.favoriteItems.splice(index, 1)
          state.favoriteItemsCount = state.favoriteItems.length
        }
      })
    },
    // 将收货地址中新建的address作为数组传进来然后放入userShippingAddress内
    handleAddNewAddress(state, newAddress) {
      state.userShippingAddress.unshift(newAddress)
      // console.log(state.userShippingAddress);
    },
    // 根据收货地址传过来对应的addressId将对应的address进行删除
    deleteAddress(state, addressId) {
      state.userShippingAddress.filter((n, index) => {
        if (n.addressId == addressId) {
          state.userShippingAddress.splice(index, 1)
        }
      })
      // console.log(state.userShippingAddress);
    },
    getEditAddressInfo(state, addressId) {
      state.userShippingAddress.filter(n => {
        if (n.addressId == addressId) {
          state.userEditAddressInfo = n
          // console.log(state.userEditAddressInfo);
        }
      })
    },
    editAddress(state, editedAddress) {
      state.userShippingAddress.filter((n, index) => {
        if (n.addressId == editedAddress.addressId) {
          state.userShippingAddress[index] = editedAddress
        }
      })
    },
    // 将购物车中新建的newOrderList作为数组传进来然后放入userOrderList内
    addNewOrderList(state, newOrderList) {
      state.userOrderList.unshift(newOrderList)
      // console.log(state.userOrderList);
    },
    // 根据订单中心传过来对应的orderListId将对应的orderListId的状态进行修改
    changeOrderListPayingStatus(state, orderListId) {
      state.userOrderList.filter((n, index) => {
        if (n.orderListId == orderListId) {
          state.userOrderList[index].status = "待收货"
          console.log(state.userOrderList[index].status);
        }
      })
    }
  },
  actions: {
  },
  getters: {
    cartItemsTotalPrice(state) { //返回购物车中所有item * item中的count的价格
      return state.cartItems.filter(function (n) {
        return n
      }).reduce(function (pre, n) {
        return pre + n.discountPrice * n.count
      }, 0)
    }
  },
  modules: {
  }
})
